<%--
 *  File:   FileRuleConfigSummary.jsp
 *  Desc:	
 *
 *  Date	  :	 2010/07/22     		    
 *  Author	:  banshang		 
 *
 *  Copyright (C) 2000 - 2008 Oval Technologies, Inc.
 *  All rights reserved.
 *
 *  This software is the confidential and proprietary information of Oval
 *  Technologies, Inc. ("Confidential Information").  You shall not
 *  disclose such Confidential Information and shall use it only in
 *  accordance with the terms of the license agreement you entered into
 *  with Oval.
--%>
<%
  //init param
  String privilegeCode = "E0511";
  String strTableName = "v_fileruleconfig";
  String strModuleName = "CFM";
	String contextPath = request.getContextPath();
%>
<%@ include file="/inc/CommonHeader.inc" %>
<%@ include file="/inc/OvalLocationDefault.inc" %>

<html>
<head>
<title>FileRuleConfigSummary</title>
<PageFlow:CheckPageFlow pageName="p_fileruleconfigsummary"/>
<%@ include file="/inc/SumDiv.inc" %>

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="<%=contextPath%>/css/<%= strLanguageCode %>/main.css" type="text/css">
<script language="JavaScript" src="<%=contextPath%>/css/<%= strLanguageCode %>/script.js"></script>
<script language="JavaScript" src="<%=contextPath%>/js/ScriptLib.js"></script>
<script language="JavaScript" src="<%=contextPath%>/js/SummaryDivision.js"></script>
<script language="JavaScript">
<%--  put your custom script here   --%>
function page_summary(actionvalue,orderbyname)
{
  var editform = summaryPrepare(cform,actionvalue,orderbyname);
  if(!editform) return;
  editform.action = "FileRuleConfigSummary.jsp?<%= OvalTools.randomURL() %>";
  editform.target = "_self";
  isRunning = true;
  editform.submit();
}
function clickRow(obj,idx)
{
  var cform = document.cform;
  if (!cform.radiorow.length)
  {
      cform.radiorow.checked=true;
      cform.fileruleconfigid.value = eval('obj.all.fileruleconfigid').value;
      cform.fileruleconfigcode.value = eval('obj.all.fileruleconfigcode').value;
      
  }else
  {
      cform.radiorow[idx].checked=true;
      cform.fileruleconfigid.value = eval('obj.all.fileruleconfigid'+idx).value;
      cform.fileruleconfigcode.value = eval('obj.all.fileruleconfigcode'+idx).value;
     
  }
}
function page_new()
{
	self.location.href='FileRuleConfigFrm.jsp?<%= OvalTools.randomURL() %>&flag=new';
}
function page_delete()
{
	var cform = document.cform;
	var id = cform.fileruleconfigid.value;

	if(isEmpty(id) || id == -1) return;
	if ( ! confirm("<%= message.getMessageDesc("ARE_YOU_SURE") %>") )  return;
	cform.actionname.value="delete";
	isRunning = true;
    cform.submit();
}
function page_confirm()
{
  var cform = document.cform;
	var id = cform.fileruleconfigid.value;

	if(isEmpty(id) || id == -1) return;
	if ( ! confirm("<%= message.getMessageDesc("ARE_YOU_SURE") %>") )  return;
	cform.actionname.value="confirm";
	isRunning = true;
    cform.submit();
}
function page_edit()
{
	var cform = document.cform;
	var id = cform.fileruleconfigid.value;
	if(isEmpty(id) || id == -1) return;
	
	    self.location.href='FileRuleConfigFrm.jsp?<%= OvalTools.randomURL() %>&fileruleconfigid='+id+"&flag=edit";
}
function page_info()
{
var cform = document.cform;
    	var id = cform.fileruleconfigid.value;
    self.location.href='FileRuleConfigFrm.jsp?<%= OvalTools.randomURL() %>&fileruleconfigid='+id+"&flag=view";
}
</script>
</head>

<body style="overflow: auto;">
<form name="cform" method="post" action="<%=contextPath%>/Dispatcher">
    <input type="hidden" name="pagename" value="p_fileruleconfigsummary">
    <input type="hidden" name="actionname">

<%--  page location   --%>
    <%@ include file="/inc/PageLocation.inc" %>

    <table width="100%" cellspacing="0" border="0" cellpadding="0">
      <tr>
<%--  search criteria  --%>
      </tr>
      <tr>
        <td>
          
          <table width="100%" border="0" cellspacing="0">
            <%@ include file="/inc/SummarySearch.inc" %>
          </table>
        </td>
      </tr>
      <tr>
        <td>
          <table width="100%" border="1" cellpadding="0" bordercolorlight="#999999" bordercolordark="#FFFFFF" cellspacing="0" align="center">
<%--  summary title columns  --%>
<%
    ArrayList titleTdArray = new ArrayList();
    titleTdArray.add(new TD("22","&nbsp;"));
    titleTdArray.add(new TitleTD("100","L_FileNameRuleCode","fileruleconfigcode") );
    titleTdArray.add(new TitleTD("120","L_FileNameRuleDesc","fileruleconfigdesc"));
    //titleTdArray.add(new TitleTD("100","L_FileDataTypyName","filedatatypename") );
    titleTdArray.add(new TitleTD("80","L_CreateDate","createdate") );
    //titleTdArray.add(new TitleTD("70","L_FileType","filetype") );
    titleTdArray.add(new TitleTD("100","L_Separator","separator") );
    //titleTdArray.add(new TitleTD("70","L_Status","statusname") );
%>
            <custom:titletr styleClass="deepblue-left" tdArray="<%=titleTdArray%>" />

<%--  summary data columns  --%>
 <%
     ArrayList detailTdArray = new ArrayList();
     detailTdArray.add(new RadioTD());
     detailTdArray.add(new WriteTD("fileruleconfigcode").addHyperlink("javascript:page_info();",null));
     detailTdArray.add(new WriteTD("fileruleconfigdesc"));
     //detailTdArray.add(new WriteTD("filedatatypename"));
     detailTdArray.add(new WriteTD("createdate","date","dateformat"));
     
     //detailTdArray.add(new WriteTD("filetype"));
     detailTdArray.add(new WriteTD("separator"));
     //detailTdArray.add(new WriteTD("statusname"));
     
     //form hidden elements
     ArrayList hiddenArray = new ArrayList();
     hiddenArray.add(new HiddenInput("fileruleconfigid",true));
     hiddenArray.add(new HiddenInput("fileruleconfigcode",true));
     //hiddenArray.add(new HiddenInput("status",true));
 %>
            <custom:iteratetr tdArray="<%=detailTdArray%>" hiddenArray="<%=hiddenArray%>"  dataSource="allfilerules"/>
            <%@ include file="/inc/SummaryAction.inc" %>
          </table>
          <table width="100%" cellspacing="0" cellpadding="0">
            <tr><td class="summary_top"></td></tr>
            <tr>
              <td class="td_center">
             
                
              <%
                  if(pageContext.getAttribute("allfilerules")!=null){
              %>
                <a onclick="page_edit();"><custom:button type="1" label="L_Edit" imgsrc="Modify.gif" border="0" style="width:60"/></a>
                <a onclick="page_delete();"><custom:button type="1" label="L_Delete" imgsrc="delete.gif" border="0" style="width:60"/></a>
                <%-- 
                <a onclick="page_confirm();"><custom:button type="1" label="L_Confirm" imgsrc="delete.gif" border="0" style="width:60"/></a>
              	--%>
              <%}else{%>
              	<a onclick="page_new();"><custom:button type="1" label="L_New" imgsrc="new.gif" border="0" style="width:60"/></a>
              <%} %>
              </td>
            </tr>
          </table>
        </td>
      </tr>
    </table>
</form>
</body>
</html>